//
//  RecommendSegue.m
//  Karaoke
//
//  Created by 蒋 浩锋 on 12-8-29.
//  Copyright (c) 2012年 Jiang Haofeng. All rights reserved.
//

#import "RecommendSegue.h"

@implementation RecommendSegue

-(void)perform
{
    RecommendViewController *sourceViewController = self.sourceViewController;
    UIViewController *destinationViewController = self.destinationViewController;
    UIPopoverController     *popover = [[UIPopoverController alloc] initWithContentViewController:destinationViewController];
    [popover setValue:[NSNumber numberWithInt:2] forKey:@"popoverBackgroundStyle"];
    [[[popover contentViewController]  view] setBackgroundColor:[UIColor clearColor]];
    sourceViewController.popoverController = popover;
    popover.delegate = sourceViewController;
//    [popover presentPopoverFromRect:sourceViewController.currentBtn.bounds inView:sourceViewController.currentBtn permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
//    [popover presentPopoverFromBarButtonItem:sourceViewController.btnDianXuan permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    [popover presentPopoverFromRect:sourceViewController.btnDianXuan.bounds inView:sourceViewController.btnDianXuan permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
@end
